<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div id="resultBox"></div>
<form method="post" action="${ctx}/role/savePermissionsSystemMenu?callbackType=closeCurrent&navTabId=list_12 class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
<input type="hidden" name="roleId" value="${roleId}"/>
<div style=" float:left; display:block; margin:10px; overflow:auto; width:566px; height:340px; overflow:auto; border:solid 1px #CCC; line-height:21px; background:#FFF;">
<ul class="tree treeFolder treeCheck expand" oncheck="save">
	<li><a tname="name" tvalue="0">系统菜单</a>
		<ul>
			<c:forEach var="menu1" items="${rolePermissionsSystemMenu}">
				<li><a tname="name" tvalue="${menu1.id}">${menu1.text}</a>
			  	<ul>
			  		<c:forEach var="menu2" items="${menu1.item}">
			  			<li>
			  			<c:choose>
						<c:when test="${menu2.select == true}"><a tname="name" tvalue="${menu2.id}" checked="true">${menu2.text}</a> </c:when>
						<c:when test="${menu2.select == false}"><a tname="name" tvalue="${menu2.id}">${menu2.text}</a></c:when>
						</c:choose>
					
			  			</li>
					</c:forEach>
			  	</ul>
			 </li>
		  </c:forEach>
		</ul>
</ul>
</div>
<div>
<div style="width: 100%;text-align:right; padding:0 10px 0 0; float:right;">
<input type="submit" value="保  存"/>
</div>
</div>
</form>
<script type="text/javascript">
function save(){
	var json = arguments[0], result="";
	$(json.items).each(function(i){
		result += "<p>name:"+this.name + " value:"+this.value+" text: "+this.text+"</p>";
	});
}
</script>